package cn.shangtour.user.service;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.shangtour.common.pojo.User;
import cn.shangtour.common.utils.MD5Util;

import cn.shangtour.user.mapper.UserMapper;
@Service
public class UserService {

	@Autowired
	private UserMapper userMapper;
	public Integer checkUsername(String passport) {
		return userMapper.checkUsername(passport);
	}
	
	public void userSave(User user) {
		user.setUserId(UUID.randomUUID().toString());
		user.setUserPassword(MD5Util.md5(user.getUserPassword()));
		userMapper.userSave(user);
	}

	public void setPassword(User user) {
		// TODO Auto-generated method stub
		user.setUserId("77e85773-e190-4b02-b2f9-58e7cbd05066");
		
		userMapper.setPassword(user);
	}
	
	
	
	
}
